from numpy import *
import operator

def create_data_set():
    """
    This function is just one example
    """
    group = array([[1.0, 1.1], [1.0, 1.0], [0, 0], [0, 0.1]])
    labels = ['A', 'A', 'B', 'B']
    return group, labels

def classify0(inx, data_set, labels, k):
    """
    knn algorithm
    """
    data_set_size = data_set.shape[0]
    diff_mat = tile(inx, (data_set_size, 1)) - data_set
    sq_diff_mat = diff_mat ** 2
    sq_distances = sq_diff_mat.sum(axis=1)
    distances = sq_distances ** 0.5
    sorted_distIndicies = distances.argsort()
    classCount = {}

    # for i in range(k):
